/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package views;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import models.LieuAVisiter;
import org.jdesktop.swingx.table.TableColumnExt;
import tableModels.TableLieuAVisiterModel;

public class frmListLieu extends javax.swing.JPanel {
    private String _identifiant;
    /**
     * Creates new form frmNewReservation
     */
    public frmListLieu() {
        initComponents();
        initTable();
    }

  private void initTable() {
        LieuAVisiter lieuAVisiter = new LieuAVisiter();
        TableLieuAVisiterModel model = lieuAVisiter.fetchAll();
        tableLieu.setModel(model);
        TableColumnExt colId = tableLieu.getColumnExt("IDENTIFIANT");
        colId.setVisible(false);


    }
    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the FormEditor.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane1 = new javax.swing.JScrollPane();
        jXTable1 = new org.jdesktop.swingx.JXTable();
        jScrollPane2 = new javax.swing.JScrollPane();
        tableLieu = new org.jdesktop.swingx.JXTable();

        jXTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jScrollPane1.setViewportView(jXTable1);

        setLayout(new java.awt.BorderLayout());

        tableLieu.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jScrollPane2.setViewportView(tableLieu);

        add(jScrollPane2, java.awt.BorderLayout.CENTER);
    }// </editor-fold>//GEN-END:initComponents


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private org.jdesktop.swingx.JXTable jXTable1;
    private org.jdesktop.swingx.JXTable tableLieu;
    // End of variables declaration//GEN-END:variables
}
